
var hui = document.querySelector("#hui");
var red = document.querySelector("#red");
var m = document.querySelector('.hidd');
console.log(m);
var op = 0;
an.addEventListener('click',function(){
    if (op == 0){
        hui.style.display = "none";
        red.style.display = "block";
        function jc(n) {
            setTimeout(function () {
                if(n<=620){
                    m.style.height = n+"px";
                    jc(n + 5);
                }
            },1)
        }
        jc(0)
        op = 1;
    }else if(op == 1){
        hui.style.display = "block";
        red.style.display = "none";
        function jc1(n) {
            setTimeout(function () {
                if(n>=0){
                    m.style.height = n+"px";
                    jc1(n - 5);
                }
            },1)
        }
        jc1(620)
        op = 0;
    }

})


var nb = document.querySelector("#anniu")
var nav = document.querySelector("#nav_nav");
var cha = document.querySelector("#cha_a");
var lk = 0;
nb.addEventListener('click',function(){
        nav.style.display="block";
        nb.style.display = "none";
        cha.style.display = "block";


})
cha.addEventListener('click',function(){
    nav.style.display="none";
    nb.style.display = "block";
    cha.style.display = "none";
})



var un = document.querySelector("#lou");

window.onscroll = function () {
    console.log(document.documentElement.scrollTop);
    if ( document.body.scrollTop >= 230 || document.documentElement.scrollTop >= 230){
        un.style.display = 'block';
        n3list1.style.background = 'red';
        n3list1_txt.style.color = '#fff';
        n3list2.style.background = '#eee';
        n3list2_txt.style.color = '#666';
        n3list3.style.background = '#eee';
        n3list3_txt.style.color = '#666';
        n3list4.style.background = '#eee';
        n3list4_txt.style.color = '#666';
        n3list5.style.background = '#eee';
        n3list5_txt.style.color = '#666';

    }else {
        un.style.display = 'none';

    }
    n3list1.addEventListener('click',function(){
        window.scrollTo({
            top:230,
            behavior:'smooth'
        })
    })
    if ( document.body.scrollTop >= 460 || document.documentElement.scrollTop >= 460){
        n3list2.style.background = 'red';
        n3list2_txt.style.color = '#fff';
        n3list1.style.background = '#eee';
        n3list1_txt.style.color = '#666';
        n3list3.style.background = '#eee';
        n3list3_txt.style.color = '#666';
        n3list4.style.background = '#eee';
        n3list4_txt.style.color = '#666';
        n3list5.style.background = '#eee';
        n3list5_txt.style.color = '#666';


    }else {


    }
    n3list2.addEventListener('click',function(){
        window.scrollTo({
            top:460,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 785 || document.documentElement.scrollTop >= 785){
        n3list3.style.background = 'red';
        n3list3_txt.style.color = '#fff';
        n3list4.style.background = '#eee';
        n3list4_txt.style.color = '#666';
        n3list5.style.background = '#eee';
        n3list5_txt.style.color = '#666';
        n3list2.style.background = '#eee';
        n3list2_txt.style.color = '#666';
        n3list1.style.background = '#eee';
        n3list1_txt.style.color = '#666';

    }else {

    }
    n3list3.addEventListener('click',function(){
        window.scrollTo({
            top:785,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 1220 || document.documentElement.scrollTop >= 1220){
        n3list3.style.background = '#eee';
        n3list3_txt.style.color = '#666';
        n3list4.style.background = 'red';
        n3list4_txt.style.color = '#fff';
        n3list5.style.background = '#eee';
        n3list5_txt.style.color = '#666';
        n3list2.style.background = '#eee';
        n3list2_txt.style.color = '#666';
        n3list1.style.background = '#eee';
        n3list1_txt.style.color = '#666';

    }else {

    }
    n3list4.addEventListener('click',function(){
        window.scrollTo({
            top:1220,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 1689 || document.documentElement.scrollTop >= 1689){
        n3list3.style.background = '#eee';
        n3list3_txt.style.color = '#666';
        n3list4.style.background = '#eee';
        n3list4_txt.style.color = '#666';
        n3list5.style.background = 'red';
        n3list5_txt.style.color = '#fff';
        n3list2.style.background = '#eee';
        n3list2_txt.style.color = '#666';
        n3list1.style.background = '#eee';
        n3list1_txt.style.color = '#666';

    }else {

    }
    n3list5.addEventListener('click',function(){
        window.scrollTo({
            top:1689,
            behavior:'smooth'
        })
    })
    if (document.body.scrollTop >= 1770 || document.documentElement.scrollTop >= 1770){
        un.style.display = 'none';

    }
    if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400){
        top_top.style.display = 'block';
        top_top.addEventListener('click',function() {
            window.scrollTo({
                top:0,
                behavior:'smooth'
            })
        })
    }else {
        top_top.style.display = 'none';
    }
}